<?php
/**
 * Routes configuration
 *
 * In this file, you set up routes to your controllers and their actions.
 * Routes are very important mechanism that allows you to freely connect
 * different urls to chosen controllers and their actions (functions).
 *
 * PHP 5
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       app.Config
 * @since         CakePHP(tm) v 0.2.9
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
/**
 * Here, we are connecting '/' (base path) to controller called 'Pages',
 * its action called 'display', and we pass a param to select the view file
 * to use (in this case, /app/View/Pages/home.ctp)...
 */
	Router::connect('/', array('controller' => 'index', 'action' => 'index'));
/**
 * ...and connect the rest of 'Pages' controller's urls.
 */
	Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));
	
/**
 * 菜单导航
 */
	Router::connect( //左侧导航菜单
		'/Users/left/:mid/', 
		array('controller' => 'Users', 'action' => 'left'),
		array('pass' => array('mid'),'mid'=>'[1-9][0-9]{0,9}')
	);
	
/**
 * 附件管理
 */
	Router::connect( //左侧导航菜单
		'/Attachment/index/:type/:id/',
		array('controller' => 'Attachment', 'action' => 'index'),
		array('pass' => array('type')),
		array('pass' => array('id'))
	);
	
/**
 * 菜单管理
 */
	Router::connect( //添加菜单
		'/Menu/add/:parentid/',
		array('controller' => 'Menu', 'action' => 'add'),
		array('pass' => array('parentid'),'parentid'=>'[1-9][0-9]{0,9}')
	);
	
	Router::connect( //编辑菜单
		'/Menu/edit/:id/',
		array('controller' => 'Menu', 'action' => 'edit'),
		array('pass' => array('id'),'id'=>'[1-9][0-9]{0,9}')
	);
	
/**
 * 管理员管理
 */
	Router::connect( //管理员管理列表
		'/Administrator/page/:page/',
		array('controller' => 'Administrator', 'action' => 'index'),
		array('pass' => array('page'),'page'=>'[1-9][0-9]{0,9}')
	);
	
	Router::connect( //编辑管理员
		'/Administrator/edit/:uid/',
		array('controller' => 'Administrator', 'action' => 'edit'),
		array('pass' => array('uid'),'uid'=>'[1-9][0-9]{0,9}')
	);
	
/**
 * 日志管理
 */
	Router::connect( //日志管理列表
		'/Logs/*',
		array('controller' => 'Logs', 'action' => 'index')
	);
	
/**
 * 用户管理
 */
	Router::connect( //用户管理列表
		'/Members/index/*',
		array('controller' => 'Members', 'action' => 'index')
	);
	
	Router::connect( //编辑用户
		'/Members/edit/:uid/',
		array('controller' => 'Members', 'action' => 'edit'),
		array('pass' => array('uid'),'uid'=>'[1-9][0-9]{0,9}')
	);
	
/**
 * 角色管理
 */
	Router::connect( //角色编辑
		'/Role/edit/:roleid/',
		array('controller' => 'Role', 'action' => 'edit'),
		array('pass' => array('roleid'),'roleid'=>'[1-9][0-9]{0,9}')
	);
	
	Router::connect( //权限设置左侧导航
		'/Role/priv_setting/:roleid/',
		array('controller' => 'Role', 'action' => 'priv_setting'),
		array('pass' => array('roleid'),'roleid'=>'[1-9][0-9]{0,9}')
	);
	
	Router::connect( //权限设置
		'/Role/rolepriv/:roleid/',
		array('controller' => 'Role', 'action' => 'rolepriv'),
		array('pass' => array('roleid'),'roleid'=>'[1-9][0-9]{0,9}')
	);
	
	Router::connect( //栏目左侧导航
		'/Role/setting_cat_priv/:roleid/',
		array('controller' => 'Role', 'action' => 'setting_cat_priv'),
		array('pass' => array('roleid'),'roleid'=>'[1-9][0-9]{0,9}')
	);
	
	Router::connect( //栏目设置
		'/Role/columnpriv/:roleid/',
		array('controller' => 'Role', 'action' => 'columnpriv'),
		array('pass' => array('roleid'),'roleid'=>'[1-9][0-9]{0,9}')
	);
	
	Router::connect( //成员管理
		'/Role/member/:roleid/',
		array('controller' => 'Role', 'action' => 'member'),
		array('pass' => array('roleid'),'roleid'=>'[1-9][0-9]{0,9}')
	);
	
	Router::connect( //角色成员列表
		'/Role/member/:roleid/:page/',
		array('controller' => 'Role', 'action' => 'member'),
		array('pass' => array('roleid','page'),'roleid'=>'[1-9][0-9]{0,9}','page'=>'[1-9][0-9]{0,9}')
	);
	
/**
* 焦点图管理
*/
	Router::connect( //焦点图分类列表
		'/Focus/cate/page/:page/',
		array('controller' => 'Focus', 'action' => 'cate'),
		array('pass' => array('page'),'page'=>'[1-9][0-9]{0,9}')
	);
	
	Router::connect( //编辑焦点图分类
		'/Focus/editCate/:id/',
		array('controller' => 'Focus', 'action' => 'editCate'),
		array('pass' => array('id'),'id'=>'[1-9][0-9]{0,9}')
	);
	
	Router::connect( //焦点图列表
		'/Focus/index/*',
		array('controller' => 'Focus', 'action' => 'index')
	);
	
	Router::connect( //编辑焦点图
		'/Focus/edit/:id/',
		array('controller' => 'Focus', 'action' => 'edit'),
		array('pass' => array('id'),'id'=>'[1-9][0-9]{0,9}')
	);
	
/**
* 内容管理--管理栏目
*/
	Router::connect( //编辑栏目
		'/Content/addCate/:parentid/',
		array('controller' => 'Content', 'action' => 'addCate'),
		array('pass' => array('parentid'),'parentid'=>'[1-9][0-9]{0,9}')
	);
	
	Router::connect( //编辑栏目
		'/Content/editCate/:id/',
		array('controller' => 'Content', 'action' => 'editCate'),
		array('pass' => array('id'),'id'=>'[1-9][0-9]{0,9}')
	);
	
	Router::connect( //删除栏目
		'/Content/delCate/:id/',
		array('controller' => 'Content', 'action' => 'delCate'),
		array('pass' => array('id'),'id'=>'[1-9][0-9]{0,9}')
	);
	
	Router::connect( //管理内容
		'/Content/manage/:cid/*',
		array('controller' => 'Content', 'action' => 'manage'),
		array('pass' => array('cid'),'cid'=>'[1-9][0-9]{0,9}')
	);
	
	Router::connect( //添加内容
		'/Content/addContent/:cid/',
		array('controller' => 'Content', 'action' => 'addContent'),
		array('pass' => array('cid'),'cid'=>'[1-9][0-9]{0,9}')
	);
	Router::connect( //编辑内容
		'/Content/editContent/:cid/:id/',
		array('controller' => 'Content', 'action' => 'editContent'),
		array('pass' => array('cid'),'cid'=>'[1-9][0-9]{0,9}'),
		array('pass' => array('id'),'id'=>'[1-9][0-9]{0,9}')
	);
	Router::connect( //相关文章
		'/Content/relationlist/:cid/*',
		array('controller' => 'Content', 'action' => 'relationlist'),
		array('pass' => array('cid'),'cid'=>'[1-9][0-9]{0,9}')
	);
	Router::connect( //评论内容
		'/Content/comment/:id/*',
		array('controller' => 'Content', 'action' => 'comment'),
		array('pass' => array('id'),'id'=>'[1-9][0-9]{0,9}')
	);
	
/**
* 公告管理
*/
	Router::connect( //公告分类列表
		'/Notice/cate/page/:page/',
		array('controller' => 'Notice', 'action' => 'cate'),
		array('pass' => array('page'),'page'=>'[1-9][0-9]{0,9}')
	);
	
	Router::connect( //编辑公告分类
		'/Notice/editCate/:id/',
		array('controller' => 'Notice', 'action' => 'editCate'),
		array('pass' => array('id'),'id'=>'[1-9][0-9]{0,9}')
	);
	
	Router::connect( //公告列表
		'/Notice/page/:page/',
		array('controller' => 'Notice', 'action' => 'index')
	);
	
	Router::connect( //编辑公告
		'/Notice/edit/:id/',
		array('controller' => 'Notice', 'action' => 'edit'),
		array('pass' => array('id'),'id'=>'[1-9][0-9]{0,9}')
	);
	
/**
 * 商品管理
 */	
	Router::connect( //商品分类列表
		'/Goods/cate/page/:page/',
		array('controller' => 'Goods', 'action' => 'cate'),
		array('pass' => array('page'),'page'=>'[1-9][0-9]{0,9}')
	);
	
	Router::connect( //添加菜单
		'/Goods/addCate/:parentid/',
		array('controller' => 'Goods', 'action' => 'addCate'),
		array('pass' => array('parentid'),'parentid'=>'[1-9][0-9]{0,9}')
	);
	
	Router::connect( //编辑商品分类
		'/Goods/editCate/:id/',
		array('controller' => 'Goods', 'action' => 'editCate'),
		array('pass' => array('id'),'id'=>'[1-9][0-9]{0,9}')
	);
	
	Router::connect( //商品列表
		'/Goods/index/*',
		array('controller' => 'Goods', 'action' => 'index')
	);
	
	Router::connect( //编辑商品
		'/Goods/edit/:id/',
		array('controller' => 'Goods', 'action' => 'edit'),
		array('pass' => array('id'),'id'=>'[1-9][0-9]{0,9}')
	);
	
/**
 * 品牌管理
 */
	Router::connect( //品牌分类列表
		'/Brand/page/:page/',
		array('controller' => 'Brand', 'action' => 'index'),
		array('pass' => array('page'),'page'=>'[1-9][0-9]{0,9}')
	);
	
	Router::connect( //添加品牌
		'/Brand/add/:parentid/',
		array('controller' => 'Brand', 'action' => 'add'),
		array('pass' => array('parentid'),'parentid'=>'[1-9][0-9]{0,9}')
	);
	
	Router::connect( //编辑品牌分类
		'/Brand/edit/:id/',
		array('controller' => 'Brand', 'action' => 'edit'),
		array('pass' => array('id'),'id'=>'[1-9][0-9]{0,9}')
	);
/**
 * Load all plugin routes.  See the CakePlugin documentation on 
 * how to customize the loading of plugin routes.
 */
	CakePlugin::routes();

/**
 * Load the CakePHP default routes. Remove this if you do not want to use
 * the built-in default routes.
 */
	require CAKE . 'Config' . DS . 'routes.php';
